﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniIOC.ServiceSample
{
    public interface IScopedService : IDisposable
    { }

    public class ScopedService : IScopedService, IDisposable
    {
        private readonly Guid _identity;
        public ScopedService()
        {
            _identity = Guid.NewGuid();
            Console.WriteLine($"创建 {nameof(ScopedService)} 实例 - {_identity}");
        }

        public void Dispose()
        {
            Console.WriteLine($"释放 {nameof(ScopedService)} 实例 - {_identity}");
        }
    }
}
